Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

txt2html: update to 3.0 #27115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

srirangav
Copy link
Contributor

@srirangav srirangav commented Dec 17, 2024

Description

Update txt2html port to version 3.0 (the current version of the port apparently does not work with perl 5.30 and newer, as recently reported on macports-users).

Closes: https://trac.macports.org/ticket/71566

Type(s)
  • bugfix
  • enhancement
  • security fix
Tested on

macOS 13.7.1 22H221 arm64
Xcode 14.3.1 14E300c

Verification

Have you

  • followed our Commit Message Guidelines?
  • squashed and minimized your commits?
  • checked that there aren't other open pull requests for the same change?
  • referenced existing tickets on Trac with full URL in commit message?
  • checked your Portfile with port lint?
  • tried existing tests with sudo port test?
  • tried a full install with sudo port -vst install?
  • tested basic functionality of all binary files?
  • checked that the Portfile's most important variants haven't been broken?

@srirangav srirangav changed the title txt2html: update to 2.51 txt2html: update to 3.0 Dec 17, 2024
@Dave-Allured
Copy link
Contributor

Please add this line to the commit message.

Closes: https://trac.macports.org/ticket/71566

Copy link
Contributor

@ryandesign ryandesign left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • referenced existing tickets on Trac with full URL in commit message?

Please add to the commit message the line:

Closes: https://trac.macports.org/ticket/71566

Comment on lines 44 to 52
configure { system "cd ${worksrcpath} && \
'${perl5.bin}' './Build.PL' '--install_base' '${prefix}'" }

build { system "cd ${worksrcpath} && \
'${perl5.bin}' '${worksrcpath}/Build'" }

destroot { system "cd ${worksrcpath} && \
'${perl5.bin}' '${worksrcpath}/Build' 'install' \
'destdir=${destroot}'" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to override these phases with custom commands; the standard method used by the perl5 portgroup should work and will add a variety of arguments and environment variables that enable MacPorts features users expect.

You should almost never need to use cd in a system command; use system's -W flag instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to override these phases with custom commands; the standard method used by the perl5 portgroup should work and will add a variety of arguments and environment variables that enable MacPorts features users expect.

You should almost never need to use cd in a system command; use system's -W flag instead.

I have updated the Portfile to use the default Perl5 build system as much as possible.

I couldn't figure out how to have the default Perl5 build system supply the --install-base argument to the Build.PL script, so I kept the configure{} phase, but I used the system -W command as you suggested.

Also, I kept a modified version of the post-destroot{} phase to fix warnings about the man pages and perl5 libraries not being installed in the correct /opt/local directories.

Please let me know if I can simplify this further.

Thanks!

Comment on lines 54 to 60
post-destroot { system "mkdir '${destroot}/${prefix}/lib/perl5/${perl5.major}' && \
mv '${destroot}/${prefix}/lib/perl5/HTML' \
'${destroot}/${prefix}/lib/perl5/${perl5.major}'"
system "mv '${destroot}/${prefix}/man/man1/txt2html.1pm' \
'${destroot}/${prefix}/share/man/man1/'"
system "mv '${destroot}/${prefix}/man/man3/HTML::TextToHTML.3pm' \
'${destroot}/${prefix}/share/man/man3/'" }
Copy link
Contributor

@ryandesign ryandesign Dec 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use system for something Tcl can do natively. (All of these commands can be done natively.)

The value of ${prefix} already begins with a / so it is an error to literally precede ${prefix} with another /.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made these changes.

system "install -m 644 ${worksrcpath}/* \
${destroot}${prefix}/share/doc/${name}"
system "rm ${destroot}${prefix}/share/doc/${name}/${name}.*" }
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've changed the whitespace of the entire file in addition to making functional changes, making it very hard to identify and review the functional changes. Please separate whitespace-only changes into a separate commit, if they must be done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted the whitespace changes and only included functional changes in my latest commit. Thanks.

categories textproc
license BSD
maintainers nomaintainer
homepage ${github.homepage}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this line. github.setup does this for you automatically.

Suggested change
homepage ${github.homepage}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed this line. Thanks.

Comment on lines 24 to 25
checksums md5 037f5fdfae92181d2bb7abfb443f6949 \
rmd160 fd91190626dbf6727fac8b027b8e8fa349168450 \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MD5 algorithm is obsolete and there's no value to including it here.

Suggested change
checksums md5 037f5fdfae92181d2bb7abfb443f6949 \
rmd160 fd91190626dbf6727fac8b027b8e8fa349168450 \
checksums rmd160 fd91190626dbf6727fac8b027b8e8fa349168450 \

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed md5 from the checksums. Thanks.

@srirangav
Copy link
Contributor Author

Please add this line to the commit message.

Closes: https://trac.macports.org/ticket/71566

I have updated the commit message and the comment above with this.

@srirangav
Copy link
Contributor Author

  • referenced existing tickets on Trac with full URL in commit message?

Please add to the commit message the line:

Closes: https://trac.macports.org/ticket/71566

I have checked this box in the comment above, and have updated the comment and the commit message.

textproc/txt2html/Portfile Outdated Show resolved Hide resolved
@@ -1,12 +1,12 @@
PortSystem 1.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add another commit with non-functional changes where you fix the whitespace issues (i.e., with spaces in multiples of four).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once this pull request is merged, I will create a new pull request that fixes the whitespace issues and updates the revision to 1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there is no need to increase the "recision" but you'll need to correct the whitespace formatting before we'll merge this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @reneeotten,

Would you like me to make a separate commit on top of the one I've already made that includes the whitespace changes? If so, I would be happy to do that.

I'm asking, because normally I just amend my existing commit when fixing issues.

Thanks,

-ranga

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can amend for now. What I meant to say is that normally you would separate functional changes and whitespace changes in two separate commits. However, here you introduce wrong alignment while doing the update so it's fine to correct that and then amend your commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I have changed the space on this line to a tab to match the existing formatting. Let me know if I should revert this and instead update the lines I added / changed to use the usual formatting.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the whole Portfile should adhere to the correct whitespace....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @reneeotten,

I have pushed a new commit with whitespace changed. Please let me know if this commit is okay.

Thanks,

-ranga

textproc/txt2html/Portfile Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants